package com.wlsk.license.controller;

import com.wlsk.license.common.result.Result;
import com.wlsk.license.service.ITaskService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.mock.web.MockMultipartFile;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@AllArgsConstructor
@Api(tags = "定时任务")
@RequestMapping("/task")
public class TaskController {

    @Autowired
    private ITaskService taskService;

    @ApiOperation(value = "查询审核中的包车牌状态")
    @PostMapping("/plateReviewState")
    public Result<Void> taskSelectState() {
        taskService.taskSelectState();
        return Result.success();
    }

    @ApiOperation(value = "每天凌晨2点定时删除草稿信息")
    @PostMapping("/clearPlate")
    public Result<Void> clearPlate() {
        taskService.clearPlate();
        return Result.success();
    }

    @ApiOperation(value = "每天定时更新行政区划")
    @PostMapping("/cityCoderefresh")
    public Result<Void> cityCoderefresh() {
        taskService.cityCoderefresh();
        return Result.success();
    }

    @ApiOperation(value = "每天定时更新需要打印补录的数据")
    @PostMapping("/platePrintSupplement")
    public Result<Void> platePrintSupplement() {
        taskService.platePrintSupplement();
        return Result.success();
    }
}
